package com.mephi.oshs.model.interpreter.impl;

import com.mephi.oshs.model.interpreter.api.IContext;

public class OrExpression extends CompoundExpression {

    public OrExpression(final ComparisonExpression expressionA, final ComparisonExpression expressionB) {
        super(expressionA, expressionB);
    }

    public void interpret(final IContext c) {
        expressionA.interpret(c);
        expressionB.interpret(c);
        final Boolean result = (Boolean) c.get(expressionA) || (Boolean) c.get(expressionB);
        c.addVariable(this, result);
    }
}